package com.baosight.risk.service.xtaa.calendar.impl;

import com.baosight.risk.api.xtaa.calendar.IXtaaCalendarService;
import com.baosight.risk.base.service.BaseServiceImpl;
import com.baosight.risk.common.utils.DateUtils;
import com.baosight.risk.mapper.xtaa.calendar.TXtaaCalendarMapper;
import com.baosight.risk.service.xtaa.calendar.entity.TXtaaCalendar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @desc:
 * @author: CuiShiHao
 **/
@Service
public class XtaaCalendarServiceImpl extends BaseServiceImpl<TXtaaCalendar> implements IXtaaCalendarService {

    @Autowired
    private TXtaaCalendarMapper tXtaaCalendarMapper;

    @Override
    public String selectCalendarByDataAndTime(String date, int time) {
        TXtaaCalendar calendar = tXtaaCalendarMapper.selectCalendarByDataAndTime(date, time);
        if (calendar == null) {
            return null;
        }
        String result = DateUtils.formatYYYY_MM_DD(calendar.getCalendarDay());
        return result;
    }
}
